#!/bin/bash

sleep 120
while true
do
    if ! pgrep -x "tplink_rtsp" > /dev/null
    then
        echo "tplink_rtsp 进程不存在，启动 tplink_rtsp 命令ing" >> /tmp/hjkl
        python3 /home/ubuntu/workspace/upload_to_webdav/pull_tplink_stream.py
        echo "tplink_rtsp 进程不存在，启动 tplink_rtsp 命令 ok" >> /tmp/hjkl

    else
        echo "tplink_rtsp 进程已存在" >> /tmp/hjkl
    fi

    sleep 60
done
